<?php  
	$pPageIsPublic = true;
	include('_common.php');
	
	$objCoci = new TipoCocina();
	$objCoci ->setUid(intval($_GET["id"]));
	if (!$objCoci ->load()) Tzn::redirect("index.php");
	
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8" />
	<title>www.mifoodcourt.com | <?= $objCoci ->titulo  ?>    </title>
	<link rel="stylesheet" href="_css/main.css" type="text/css" media="screen" />
	<link rel="stylesheet" href="_css/jquery-ui-1.8.11.custom.css" type="text/css" media="screen" />
    <!-- link rel="stylesheet" href="_css/bg.css" type="text/css" media="screen" /-->
	
</head>
<body>
	<!-- img id="bgimg" src="_images/bg.jpg" /-->
	<div id="realBody">
	 <div id="wrapper">
		<div id="content">
			<header style="text-align: center;" >
				<h1><a href="/">mifoodcourt.com</a></h1>
			</header>

<?php
	if ($rcoci = $objCoci ->gRestaurantCocina()) {
		while ($item = $rcoci ->rNext()) { ?>
		
<div class="top-title">
<img align="left" src="thumb.php?src=<?= $item ->restaurant ->gImagesPath() ->gImagePath(); ?>&w=100&h=90&zc=1" /> 
<?= $item ->restaurant ->descripcion ?> 
 </div><div style="clear:both;"></div>
 
 <?php
 			if ($cats = $item ->restaurant ->gCategoria()) { ?>
 			<section id="products">
<?php  			
 				while ($cat = $cats ->rNext()) { ?>
				<div class="top-menu"  > 
					<span class="title"     ><?= $cat ->titulo ?></span>
	 			</div>
	 			
<?php
if ($menus = $cat ->gMenu()) {
	while ($menu = $menus ->rNext()) { ?>
	
<div class="item" ><span class="raq" >&raquo;</span> <a href="menu.php?id=<?= $menu ->id ?>&lightbox[width]=400&amp;lightbox[height]=300&amp;lightbox[modal]=true" class="lightbox" >
<?= $menu ->titulo ?> (S/. <?= $menu ->precio ?>)</a> 
</div>	
	
	
				<!-- div class="product_1" id="<?= $menu ->id ?>" title="<?= $menu ->titulo ?>">
					<div class="product-info">
						<h2 >
						<button class="add" onclick="addItem($(this).parent().parent().parent()); "    >Agregar</button>
						
<a href="menu.php?id=<?= $menu ->id ?>&lightbox[width]=450&amp;lightbox[height]=300&amp;lightbox[modal]=true" class="lightbox">Agregar</a>

						<span class="product-title" ><?= $menu ->titulo ?></span> (S/. <?= $menu ->precio ?>) </h2>
						<p class="id"><?= $menu ->id ?></p>
						<p class="product-description"><?= $menu ->descripcion ?></p>
					</div>
					<p class="price"><?= $menu ->precio ?></p>
					
				</div-->	
<?php 	
	}
} 
?> 	 			 	
	 						
<?php  					
 				} ?>
 			</section>						
<?php  				
 			} 
 ?>

<?php 			
		}
	} 
?>

			<aside id="followme" >
				<div id="followbox"></div>
				<div id="cart">
					<h2>Pedido</h2>
					<!-- p>Realice su pedido, arrastrando su plato de selecci&oacute;n a la seccion de abajo.</p>
					<div class="dropzone"><p>Arrastre su plato aqu&iacute;.</p></div-->
					<div class="cart-content">
						<ol>
							<li class="placeholder">Usted no tiene items en su cesta.</li>
						</ol>
					</div>
					<div class="totales" ></div>
					<div class="empty">Limpiar pedido</div>
					<div class="empty2">Enviar pedido</div>

				</div>
			</aside>
			<div id="dialog-confirm" title="Empty Cart">Desea borrar todo lo seleccionado hasta ahora?.</div>
			<div style="clear:both;"></div>		
			<footer>
				<p>&copy;2013 mifoodcourt.com - Todos los derechos reservados.</p>
			</footer>
            
  <style>
#loremipsum form { background:#eee; padding:15px; font-family:verdana; font-size:11px; width:310px; left:10px;   }
#loremipsum form fieldset {border:1px solid #eee; }
#loremipsum form fieldset legend { font-weight:bold; padding:6px;  } 
#loremipsum form input[type="text"], #loremipsum form input[type="email"] { border:1px solid #333; background:#FBF9C0; border-radius:6px; padding:2px 3px; }
#loremipsum form label { display:block; margin-bottom:6px; width:120px; height:35px;  }   
#loremipsum form input[type="reset"], #loremipsum form input[type="button"], #loremipsum form input[type="submit"]  {width:80px; border:1px solid #333; padding:2px 4px; margin-right:10px;  }

</style>
            
           <div id="loremipsum" style="display:none;" > 
            <form id="envia"  >
             <fieldset><legend> Informaci&oacute;n personal:  </legend>
             
             <label>Nombres: <input type="text" required id="txtnomb"  name="txtnomb" value="" /></label>
             <label>Zona: <?php
             	$tmp = new Zona();
             	$tmp ->loadItems();
             	$tmp ->qSelect('zona', 'titulo', '', ' ', ' background: none repeat scroll 0 0 #FBF9C0;
    border: 1px solid;
    border-radius: 6px 6px 6px 6px;
    margin: 4px 0;
    padding: 2px;
    width: 310px;');
             	 
               ?></label>
             <label>Direcci&oacute;n: <input required name="txtdirec" id="txtdirec" type="text" value="" /></label>
             <label>Tel&eacute;fono: <input required id="txtfono" name="txtfono"  type="text" value=""  /></label>
			 <label>Email: <input name="txtmail" id="txtmail" type="email" value="" /></label>
			 
			 <label style="width:240px;" >&iquest;Con cu&aacute;nto va a pagar?: (S/.) <input required id="txtpaga" name="txtpaga"  type="text" value="" style="width:60px;"    /></label>
			 
             <input type="submit" value="Enviar" name="btnEnviar" id="btnEnviar" onclick="return envia();" >     
             <input type="reset" value="Cancelar" name="btnCancelar">     
             </fieldset>
            </form>
            
            </div>
			
            
		</div>
	</div>
 </div>
<script type="text/javascript" src="_js/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="_js/jquery-ui-1.8.11.custom.min.js"></script>

<script type="text/javascript" src="_js/jquery.cookie.js"></script>
<script type="text/javascript" src="_js/jquery.scroll-follow.js"></script>


<script src="_js/jquery.masonry.min.js"></script>
<link type="text/css" rel="stylesheet" href="_css/jquery.capty.css"/>
<script type="text/javascript" src="_js/jquery.capty.min.js"></script>



<!--script type="text/javascript" src="_js/fullscreenr.js"></script-->
<script type="text/javascript">  
	/*var FullscreenrOptions = {  width: 1322, height: 897, bgID: '#bgimg' };
	jQuery.fn.fullscreenr(FullscreenrOptions);
	$(function() {

			$('.default').capty({ animation: 'fixed'});
			
	});*/

	function envia() {
		//alert(decodeURIComponent($('form#envia').serialize()));

				
		var par = "";
		//var asset = "";
		$('.cart-item').each(function(a,ele) {
    		//st = st + (parseFloat($(ele).attr('data-price')) * parseInt($(ele).find('input').val())) ;
    		/*par = par + "menu["+ $(ele).attr('data-productid') +"]=" + $(ele).find('input').val() + "&";*/
			par = par + "menu["+ $(ele).attr('data-productid') +"][q]=" + $(ele).find('input').val() + "&";
			par = par + "menu["+ $(ele).attr('data-productid') +"][asset]=" + $(ele).attr('data-asset') + "&";
			
    		//asset = asset + "&aseet["+ $(ele).attr('data-productid') +"]=" + $(ele).attr('data-asset');
    	});

		var zona = "&zona=" + $("select[name='zona']").find("option:selected").text();
		

		//alert(decodeURIComponent($('form#envia').serialize()));
		
		$.ajax({
			type: "POST",
			url: "mail.php",
			data: par + decodeURIComponent($('form#envia').serialize()) + zona, //+ asset,  
			success: function(response) {
				if (response) {
					alert("Gracias por su pedido, estaremos en contacto con ud. lo mas pronto posible.");
					$.lightbox().close();
				}	
			}	
		});


		var content = $('.cart-item');
		content.remove();
		$('cart-content').find('.placeholder').show();
		$(this).dialog('close');
		emptyBtn.fadeOut('500');
		emptyBtn2.fadeOut('500');
		emptyText.fadeIn('500');
		$('.totales').html("");
				
		return false;
		
	}
	
</script>

<script type="text/javascript">
   		$( document ).ready( function ()
			{
				$( '#followme' ).scrollFollow(
					{
						speed: 1000,
						offset: 10,
						/*killSwitch: 'exampleLink',
						onText: 'Disable Follow',
						offText: 'Enable Follow' */
					}
				);
			}
		);
</script>


<link rel="stylesheet" type="text/css" href="_js/lightbox/themes/default/jquery.lightbox.css" />
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="_js/lightbox/themes/default/jquery.lightbox.ie6.css" />
<![endif]-->
<script type="text/javascript" src="_js/lightbox/jquery.lightbox.min.js"></script>
<script type="text/javascript">
  jQuery(document).ready(function($){
    $('.lightbox').lightbox();
//	$('button[title]').qtip();
  });
  
</script>

<!--link rel="stylesheet" type="text/css" href="_js/jquery.qtip.min.css" /-->
<!--script type="text/javascript" src="_js/jquery.qtip.min.js"></script-->

<script type="text/javascript" src="_js/jquery.jfollow.js"></script>
<script type="text/javascript" src="_js/script.js"></script>
<script type="text/javascript" src="_js/cart.js"></script>
</body>
</html>